<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  const obj = {
    _a: 1,
    _b: 2,
    _c: {
      _c1: 3,
      _c2: 4
    }
  }

  const defineReactive = (obj) => {
    for (const objKey in obj) {
      let v = obj[objKey]
      if (typeof v === 'object' && v !== null ) {
        defineReactive(v)
      }
      Object.defineProperty(obj, objKey, {
        get() {
          console.log('get ', objKey)
          return v
        },
        set(value) {
          console.log('set ', objKey)
          v = value
        }
      })
    }
  }

  defineReactive(obj)
  console.log(obj._c._c2)
  obj._a = 999
  console.log(obj._a)
</script>
</body>
</html>